/*
 * Locations to visit in the game
 *
 */

import java.util.Vector;

/**
 *
 * @author dirk
 */
public class Location
{   
        //Members
        private String m_roomTitle;
	private String m_roomDescription;
        private String m_blockDescription;
        private String m_item = null;
        private String m_needItem = null;
	private Vector m_vecExits;

        // Create blank constructor
	public Location()
	{
		// Blank title + description
		m_roomTitle = new String ();
		m_roomDescription = new String();
                m_blockDescription = new String();
		m_vecExits = new Vector();
	}
	// Partial constructor
	public Location( String title )
	{
		// Assign title
		m_roomTitle = title;

		// Blank description
		m_roomDescription = new String();
                m_blockDescription = new String();
		// Blank exits
		m_vecExits = new Vector();
	}

	//Almost Full constructor
	public Location( String title, String description )
	{
		// Assign title + description
		m_roomTitle = title;
		m_roomDescription = description;
                m_blockDescription = new String();
		// Blank exits
		m_vecExits = new Vector();
	}	//Almost Full constructor

        //Almost Full constructor + item
        public Location( String title, String description, String item )
	{
		// Assign title + description
		m_roomTitle = title;
		m_roomDescription = description;
                m_blockDescription = new String();
                m_item = item;
		// Blank exits
		m_vecExits = new Vector();
	}


	//Full constructor
	public Location( String title, String description, String item, String blockDescription, String needItem )
	{
		// Assign title + description
		m_roomTitle = title;
		m_roomDescription = description;

                //Null item
                m_item = item;
                m_needItem = needItem;
                m_blockDescription = blockDescription;
		// Blank exits
		m_vecExits = new Vector();
	}

	// toString method
	public String toString()
	{
		return m_roomTitle;
	}

	// Adds an exit to this location
	public void addExit ( Exit exit )
	{
		m_vecExits.addElement (exit);
	}

	// Removes an exit from this location
	public void removeExit ( Exit exit )
	{
		if (m_vecExits.contains (exit))
		{
			m_vecExits.removeElement (exit);
		}
	}

	// Returns a vector of exits
	public Vector getExits ()
	{
		// Return a clone, as we don't want an external
		// object to modify our original vector
		//return (Vector) m_vecExits.clone();

                //EDIT EDIT ! ! !


                return (m_vecExits);
	}
 

	// Returns location title
	public String getTitle()
	{
		return m_roomTitle;
	}

	// Assigns location title
	public void setTitle( String roomTitle )
	{
		m_roomTitle = roomTitle;
	}

	// Returns location description
	public String getDescription()
	{
		return m_roomDescription;
	}

        // Return the block description
        public String getBlockDescription()
        {
                return m_blockDescription;
        }

        // Returns location description
	public String getNeedItem()
	{
		return m_needItem;
	}

        // Returns location description
	public String getItem()
	{
		return m_item;
	}

	// Assigns location description
	public void setDescription( String roomDescription )
	{
		m_roomDescription = roomDescription;
	}

}
